package com.wwp.tbshop.presenter;


import com.wwp.tbshop.model.bean.OrderListBaseBean;
import com.wwp.tbshop.model.bean.OrderListItemDetailBean;
import com.wwp.tbshop.model.bean.OrderListItemsBean;
import com.wwp.tbshop.model.bean.OrderSubmitResponseBean;

import java.util.HashMap;

import retrofit2.Call;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by user on 2017/6/15.
 */

public interface OrderListService {
    //userId fixed to be 20428 temply

    @GET("orderlist")
    Call<OrderListItemsBean> getOrderList(
            @Header("userid") int userid,
            @Query("type") int type,
            @Query("page") int page,
            @Query("pageNum") int pageNum);

    @GET("orderdetail")
    Call<OrderListItemDetailBean> getOrderDetail(
            @Header("userid") int userid,
            @Query("orderId") int orderId
    );

    @GET("ordercancel")
    Call<OrderListBaseBean> requestCancelOrder(
            @Header("userid") int userid,
            @Query("orderId") int orderId);

/*    @FormUrlEncoded
    @POST("ordersumbit")//
    Call<OrderSubmitResponseBean> orderSubmit2(
            @Header("userid") int userId,
            @Field("sku") String sku,
            @Field("addressId") String addressId,
            @Field("paymentType") String paymentType,
            @Field("deliveryType") String deliveryType,
            @Field("invoiceType") String invoiceType,
            @Field("invoiceTitle") String invoiceTitle,
            @Field("invoiceContent") String invoiceContent);*/

    @FormUrlEncoded
    @POST("ordersumbit")
    Call<OrderSubmitResponseBean> orderSubmit(
            @Header("userid") int userId,
            @FieldMap HashMap<String,String> params
           );
}
